package liangtWorkSpace.springAll.di.annotation.required;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author liangt
 * @ClassName: MainApp
 * @title: MainApp
 * @projectName liangtWorkSpace.springAll.di.annotation.Beans
 * @description: Spring 注解 @Required
 * @date 2020/10/16 10:31
 */
public class AnnotationMain {

    public static void main(String[] args) {
        String xmlPath = "DI/annotation/Beans.xml";
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext(xmlPath);

        Student student = (Student) applicationContext.getBean("student");
        student.setName("lilei");
        System.out.println("Age ：" + student.getAge());
        System.out.println("Name : " + student.getName());
    }
}
